#ifndef CPP_SWITCH_STYLE_H
#define CPP_SWITCH_STYLE_H

#include <widget/View.h>
class Bitmap;
class Rect;
class Font;

//@brief 开关控件风格
//@author cvte
//@description 提供Switch开关控件风格统一接口
class SwitchStyle {
   public:
    SwitchStyle();
    virtual ~SwitchStyle();

    void setTrackBitmap(int x, int y, Bitmap& bitmap);
    void setThumbBitmap(int x, int y, Bitmap& bitmap);

    void setText(const char* text, Font& font, Rect rect, int color, TextAlignStyle style);
    const char* getText();
    void setShowText(bool shouldShowText);

    void draw(Canvas& canvas);

   private:
    Bitmap* mTrackBitmap = nullptr;
    int mTrackBitmapX;
    int mTrackBitmapY;
    Bitmap* mThumbBitmap = nullptr;
    int mThumbBitmapX;
    int mThumbBitmapY;

    const char* mText;
    Font* mTextFont;
    Rect mTextRect;
    int mTextColor;
    TextAlignStyle mTextAlignStyle;

    bool mShouldShowText;
};

#endif